/*
 * Copyright (c) 2006, 2022, webrx.cn All rights reserved.
 *
 */
package cn.webrx;

/**
 * <p>Project: javase2203 - C8
 * <p>Powered by webrx On 2022-07-20 09:41:13
 * <p>Created by IntelliJ IDEA
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class C8 {
    private int num;

    //setter
    public void setNum(int num){
        if(num<18){
            this.num = 18;
        }else {
            this.num = num;
        }
    }

    //getter  c.num 会自动的调用 getNum() 方法
    public int getNum(){
        return this.num;
    }


    public static void main(String[] args) {
        C8 c = new C8();
        c.num = 60;
    }
}
